<?php
include_once('../model/connect.php');
include_once ('../model/Student/class-student.php');
session_start();

$studentid = $_POST['studentid'];
$courseid = $_POST['courseid'];

if(!empty($courseid)) {
	////
	foreach($courseid as $cid)
    {     
		$sql = "INSERT INTO `courseregistration` (`STUDENT_ID`, `COURSE_ID`, `APPROVED`, `REGISTRATION_DATE`) VALUES ( '".$studentid."', '".$cid."', 'notyet', NOW());";	
		mysql_query($sql);
	}
}
header("location:http:/educational/student-course-register.php");
mysql_close($conn);

?>